﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using CSF.Utility.Mvc;
using CSF.Sales.Data;

namespace CSF.WebApp.Admin.Areas.WebShop.Controllers
{
    public class PromotionController : SecureController
    {
        //
        // GET: /WebShop/Promotion/
        [CsfAuthorize]
        public ActionResult Index(bool isDisable = false)
        {
            return View();
        }

        //
        // GET: /WebShop/Promotion/Add
        [CsfAuthorize]
        public ActionResult Add()
        {
            return View();
        } 

        //
        // POST: /WebShop/Promotion/Add
        [CsfAuthorize]
        [HttpPost]
        public ActionResult Add(Promotion model)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /WebShop/Promotion/Edit/5
        [CsfAuthorize]
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /WebShop/Promotion/Edit/5
        [CsfAuthorize]
        [HttpPost]
        public ActionResult Edit(int id, Promotion model)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /WebShop/Promotion/Delete/5
        [CsfAuthorize]
        public ActionResult Delete(IEnumerable<int> id, string toUrl)
        {
            return Redirect(toUrl);
        }

    }
}
